//
//  LWPhotoSelectCell.m
//  1.28  weibo
//
//  Created by mac on 15/2/13.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "LWPhotoSelectCell.h"

@interface LWPhotoSelectCell ()
@property (weak, nonatomic) IBOutlet UIButton *addBtn;
@property (weak, nonatomic) IBOutlet UIButton *deleatBtn;
- (IBAction)addClick:(UIButton *)sender;
- (IBAction)delectClick:(UIButton *)sender;


@end

@implementation LWPhotoSelectCell

- (IBAction)addClick:(UIButton *)sender {
   
    //添加通知事件
    [[NSNotificationCenter defaultCenter] postNotificationName:LWAddPhotoNotification object:self];
}
- (IBAction)delectClick:(UIButton *)sender {
    [[NSNotificationCenter defaultCenter] postNotificationName:LWDeletePhotoNotification object:self];
}

- (void)setIconImage:(UIImage *)iconImage{

    _iconImage = iconImage;
    if (iconImage == nil) {
        self.deleatBtn.hidden = YES;
        [self.addBtn setBackgroundImage:[UIImage imageNamed:@"compose_pic_add"] forState:UIControlStateNormal];
        [self.addBtn setBackgroundImage:[UIImage imageNamed:@"compose_pic_add_highlighted"] forState:UIControlStateHighlighted];
    }else{
        self.deleatBtn.hidden = NO;
        [self.addBtn setBackgroundImage:_iconImage forState:UIControlStateNormal];
    }
    
    
}

@end
